#ifndef __VERTEX_BUFFER_GLES_H__
#define __VERTEX_BUFFER_GLES_H__

#pragma once

#include "RendererGLESCompileConfig.h"
#include "VertexBuffer.h"

namespace Nezha
{

	class RendererGLES;

	class VertexBufferGLES : public VertexBuffer
	{
	public:
		/** we use shadow buffer always
		maybe use glMapBufferOES later.
		*/
		VertexBufferGLES(u32 vertexStride, u32 numVertex, HardwareBuffer::Usage usage
			,RendererGLES* r, float* data);
		~VertexBufferGLES();

		GLuint getBufferId() const
		{
			return mGLBufferId;
		}

NEZHA_INTERNAL:

		void* _internalAccess_FEOV()
		{
			return mShadowBuffer.data();
		}
	protected:
		// we use shadow buffer always
		virtual void* lockImpl(u32 offset, u32 length, LockOption opt);
		virtual void unlockImpl();
		virtual void syncShadowBuffer();

	private:
		GLuint mGLBufferId;
		RendererGLES* mRenderer;
	};

}//end namespace Nezha

#endif //end __VERTEX_BUFFER_GLES_H__